//
//  TimeLineCell.m
//  EducationAdminClient
//
//  Created by xuyingwei on 16/11/8.
//  Copyright © 2016年 周佳兴. All rights reserved.
//

#import "TimeLineCell.h"
#import "Masonry.h"
#import "UIColor+CL.h"
#import "UIStyle.h"
#import "EducationAdminClient_URL.h"
@implementation TimeLineCell

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    //    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    if (self) {
        UIView *superView = [self createUI];
        superView.backgroundColor = [UIColor whiteColor];
        superView.layer.cornerRadius = 8;
        self.backgroundColor = [UIColor clearColor];
        
        [self.contentView addSubview:superView];
        //#ifdef Main
        if([getUIStyle() isEqualToString:STYLE0]){
            [superView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(self.contentView.mas_left).offset(26/2);
                make.top.equalTo(self.contentView.mas_top).offset(26/2);
                make.right.equalTo(self.contentView.mas_right).offset(-26/2);
                make.bottom.equalTo(self.contentView.mas_bottom);
            }];
            
        }else{
            //#elif Student
            
            [superView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(self.contentView.mas_left).offset(142/2);
                make.top.equalTo(self.contentView.mas_top).offset(20/2);
                make.right.equalTo(self.contentView.mas_right).offset(-36/2);
                make.bottom.equalTo(self.contentView.mas_bottom);
            }];
            
            if (!_redPoint) {
                _redPoint = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"garden"]];
//                _redPoint.layer.cornerRadius = 6.0f;
//                _redPoint.backgroundColor = [UIColor colorWithHex:0xef5152];
                [self.contentView addSubview:_redPoint];
                [_redPoint mas_makeConstraints:^(MASConstraintMaker *make) {
                    make.top.equalTo(self.contentView.mas_top).offset(48/2);
                    make.left.equalTo(self.contentView.mas_left).offset((120-6)/2);
                    make.width.equalTo(@(16/2));
                    make.height.equalTo(@(16/2));
                    
                }];
                
            }
            if (!_yearLabel) {
                UIImageView *iva = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"red"]];
                [self.contentView addSubview:iva];
                [iva mas_makeConstraints:^(MASConstraintMaker *make) {
                    make.centerY.equalTo(_redPoint.mas_centerY);
                    make.right.equalTo(_redPoint.mas_centerX).offset(-(14)/2);
                    make.left.equalTo(self.contentView.mas_left).offset(10/2);
                    make.height.equalTo(@(40/2));
                }];
                
                
                _yearLabel = [[UILabel alloc] init];
                [self.contentView addSubview:_yearLabel];
                [_yearLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                    make.centerY.equalTo(_redPoint.mas_centerY);
                    make.right.equalTo(_redPoint.mas_centerX).offset(-(14)/2);
                    make.left.equalTo(self.contentView.mas_left).offset(10/2);
                    make.height.equalTo(@(40/2));
                }];
                _yearLabel.textColor = [UIColor whiteColor];
                _yearLabel.backgroundColor = [UIColor colorWithHex:0xef5152];
                _yearLabel.font = [UIFont systemFontOfSize:32/2];
                _yearLabel.hidden = YES;
                _yearLabel.textAlignment = NSTextAlignmentCenter;
            }
            
            if (!_monLabel) {
                _monLabel = [[UILabel alloc] init];
                [self.contentView addSubview:_monLabel];
                [_monLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                    make.top.equalTo(_yearLabel.mas_bottom).offset(16/2);
                    make.right.equalTo(_redPoint.mas_left).offset(-(16-7)/2);
                    make.height.equalTo(@(30/2));
                    
                    
                }];
//                _monLabel.backgroundColor = [UIColor redColor];
                _monLabel.textColor = [UIColor colorWithHex:0x4c4c4c];
                _monLabel.font = [UIFont systemFontOfSize:30/2];
                _monLabel.hidden = YES;
            }
            if (!_dayLabel) {
                _dayLabel = [[UILabel alloc] init];
                [self.contentView addSubview:_dayLabel];
                [_dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                    make.top.equalTo(_monLabel.mas_bottom).offset(16/2);
                    make.right.equalTo(_redPoint.mas_left).offset(-(16-7)/2);
                    make.height.equalTo(@(24/2));
                    
                    
                }];
                _dayLabel.textColor = [UIColor colorWithHex:0x858585];
                _dayLabel.font = [UIFont systemFontOfSize:24/2];
                _dayLabel.hidden = YES;
            
            }
            
        }
        //#elif Teacher
        //        //    rootview
        //        NSLog(@"老师端程序");
        //#else
        //
        //        NSLog(@"都不是");
        //#endif
        
    }
    return self;
}

-(UIView *)createUI{
    self.baseView = [[UIView alloc]init];
    
    //    UIImageView *titleImgView = [[UIImageView alloc]init];
    //    [self.baseView addSubview:titleImgView];
    
    self.titleLeftImg = [[UIImageView alloc]init];
    [self.baseView addSubview:self.titleLeftImg];
    
    self.titleLabel = [[UILabel alloc]init];
    [self.baseView addSubview:self.titleLabel];
    
    self.titleRightImg = [[UIImageView alloc]init];
    [self.baseView addSubview:self.titleRightImg];
    
    self.Label1 = [[UILabel alloc]init];
    [self.baseView addSubview:self.Label1];
    
    self.Label2 = [[UILabel alloc]init];
    [self.baseView addSubview:self.Label2];
    
    self.Label3 = [[UILabel alloc]init];
    [self.baseView addSubview:self.Label3];
    
    self.Label4 = [[UILabel alloc]init];
    [self.baseView addSubview:self.Label4];
    
    self.Label1R = [[UILabel alloc]init];
    [self.baseView addSubview:self.Label1R];
    
    self.Label2R = [[UILabel alloc]init];
    [self.baseView addSubview:self.Label2R];
    
    self.Label3R = [[UILabel alloc]init];
    [self.baseView addSubview:self.Label3R];
    
    self.Label4R = [[UILabel alloc]init];
    [self.baseView addSubview:self.Label4R];
    
    [self.Label1 setContentHuggingPriority:UILayoutPriorityRequired
                                   forAxis:UILayoutConstraintAxisHorizontal];//宽度够的时候优先级宽度根据label内容
    [self.Label2 setContentHuggingPriority:UILayoutPriorityRequired
                                   forAxis:UILayoutConstraintAxisHorizontal];//宽度够的时候优先级宽度根据label内容
    [self.Label3 setContentHuggingPriority:UILayoutPriorityRequired
                                   forAxis:UILayoutConstraintAxisHorizontal];//宽度够的时候优先级宽度根据label内容
    [self.Label4 setContentHuggingPriority:UILayoutPriorityRequired
                                   forAxis:UILayoutConstraintAxisHorizontal];//宽度够的时候优先级宽度根据label内容
    [self.Label1 setContentCompressionResistancePriority:UILayoutPriorityRequired
                                                 forAxis:UILayoutConstraintAxisHorizontal];
    //    [self.Label1 setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
    
    
    [self.Label2 setContentCompressionResistancePriority:UILayoutPriorityRequired
                                                 forAxis:UILayoutConstraintAxisHorizontal];
    //    [self.Label2 setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
    
    
    [self.Label3 setContentCompressionResistancePriority:UILayoutPriorityRequired
                                                 forAxis:UILayoutConstraintAxisHorizontal];
    //    [self.Label3 setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
    
    
    [self.Label4 setContentCompressionResistancePriority:UILayoutPriorityRequired
                                                 forAxis:UILayoutConstraintAxisHorizontal];
    //    [self.Label4 setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
    
    _imgLine = [[UIImageView alloc]init];
    //    [self.Label2 sizeToFit];
    [self.baseView addSubview:_imgLine];
    
    
    self.mormalBtn = [[NormalButton alloc]init];
    [self.baseView addSubview:self.mormalBtn];
    
    //    [titleImgView mas_makeConstraints:^(MASConstraintMaker *make) {
    //        make.left.equalTo(self.baseView.mas_left);
    //        make.top.equalTo(self.baseView.mas_top).offset(26/2);
    //        make.right.equalTo(self.baseView.mas_right);
    ////        make.height.equalTo(@(30));
    //    }];
    
    [self.titleLeftImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.baseView.mas_left);
        make.centerY.equalTo(self.titleLabel.mas_centerY);
        make.width.equalTo(@(4/2));
        make.height.equalTo(@(20));
    }];
    
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
#pragma mark - 学员端代码处理
        //#ifdef Main
        //        make.left.equalTo(self.titleLeftImg.mas_right).offset(10);
        //#else
        make.left.equalTo(self.titleLeftImg.mas_right).offset(30/2);
        //#endif
        make.top.equalTo(self.baseView.mas_top).offset(26/2);
        //        make.width.equalTo(@(100));
        //        make.height.equalTo(@(30));
    }];
    
    [self.titleRightImg mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.equalTo(self.baseView.mas_right).offset(-34/2);
        make.centerY.equalTo(self.titleLabel.mas_centerY);
        make.width.equalTo(@(32/2));
        make.height.equalTo(@(32/2));
    }];
    
    [self.Label1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(40/2);
        //#ifdef Main
        if([getUIStyle() isEqualToString:STYLE0]){
            //        make.width.equalTo(@(100));
        }else{
        }
        //    }
        //#endif
        //        make.height.equalTo(@(30));
    }];
    
    [self.Label2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.Label1.mas_left);
        make.top.equalTo(self.Label1.mas_bottom).offset(38/2);
        
        
    }];
    
    [self.Label3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.Label2.mas_left);
        make.top.equalTo(self.Label2.mas_bottom).offset(38/2);
        
    }];
    
    [self.Label4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.Label3.mas_left);
        make.top.equalTo(self.Label3.mas_bottom).offset(38/2);
        
    }];
    
    [self.Label1R mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.Label1.mas_right).offset(25);
        
        make.centerY.equalTo(self.Label1.mas_centerY);
        make.right.equalTo(self.baseView.mas_right).offset(-30/2);
        
        
    }];
    
    [self.Label2R mas_makeConstraints:^(MASConstraintMaker *make) {
        //#ifdef Main
        //        make.left.equalTo(self.Label2.mas_right).offset(20);
        //        make.right.equalTo(self.titleRightImg.mas_left);
        //#else
        make.left.equalTo(self.Label2.mas_right).offset(25);
        //#endif
        
        make.centerY.equalTo(self.Label2.mas_centerY);
        make.right.equalTo(self.baseView.mas_right).offset(-30/2);
        //        make.height.equalTo(@(30));
    }];
    
    [self.Label3R mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.Label3.mas_right).offset(25);
        
        make.right.equalTo(self.baseView.mas_right).offset(-30/2);
        make.centerY.equalTo(self.Label3.mas_centerY);
        
        //        make.height.equalTo(@(30));
    }];
    
    [self.Label4R mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.Label4.mas_right).offset(25);
        
        make.right.equalTo(self.baseView.mas_right).offset(-30/2);
        make.centerY.equalTo(self.Label4.mas_centerY);
        
        //        make.height.equalTo(@(30));
    }];
    
    [_imgLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.baseView.mas_centerX);
        make.top.equalTo(self.Label4.mas_bottom).offset(40/2);
        make.left.equalTo(self.baseView.mas_left).offset(10);
        make.right.equalTo(self.baseView.mas_right).offset(-10);
        make.height.equalTo(@(1));
    }];
    
    [self.mormalBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.baseView.mas_centerX);
        make.top.equalTo(_imgLine.mas_bottom).offset(26/2);
        make.width.equalTo(@(654/2));
        make.height.equalTo(@(70/2));
    }];
    
    [ self.mormalBtn setBackgroundColor:[UIColor colorWithRed:95.0/255.0 green:168.0/255.0 blue:252.0/255.0 alpha:1]];
    
    self.mormalBtn.layer.cornerRadius = 5;
    self.Label1.font = [UIFont systemFontOfSize:28/2];
    self.Label1.textColor = [UIColor colorWithRed:0xa3/255.0 green:0xa3/255.0 blue:0xa3/255.0 alpha:1];
    
    self.Label2.font = [UIFont systemFontOfSize:28/2];
    self.Label2.textColor = [UIColor colorWithRed:0xa3/255.0 green:0xa3/255.0 blue:0xa3/255.0 alpha:1];
    
    self.Label3.font = [UIFont systemFontOfSize:28/2];
    self.Label3.textColor = [UIColor colorWithRed:0xa3/255.0 green:0xa3/255.0 blue:0xa3/255.0 alpha:1];
    
    self.Label4.font = [UIFont systemFontOfSize:28/2];
    self.Label4.textColor = [UIColor colorWithRed:0xa3/255.0 green:0xa3/255.0 blue:0xa3/255.0 alpha:1];
    
    self.Label1R.font = [UIFont systemFontOfSize:32/2];
    self.Label1R.textColor = [UIColor colorWithRed:0x5b/255.0 green:0x5b/255.0 blue:0x5b/255.0 alpha:1];
    
    self.Label2R.font = [UIFont systemFontOfSize:32/2];
    self.Label2R.textColor = [UIColor colorWithRed:0x5b/255.0 green:0x5b/255.0 blue:0x5b/255.0 alpha:1];
    
    self.Label3R.font = [UIFont systemFontOfSize:32/2];
    self.Label3R.textColor = [UIColor colorWithRed:0x5b/255.0 green:0x5b/255.0 blue:0x5b/255.0 alpha:1];
    
    self.Label4R.font = [UIFont systemFontOfSize:32/2];
    self.Label4R.textColor = [UIColor colorWithRed:0x5b/255.0 green:0x5b/255.0 blue:0x5b/255.0 alpha:1];
    
    self.titleLabel.font = [UIFont systemFontOfSize:32/2];
    self.titleLabel.textColor = [UIColor colorWithRed:0x4c/255.0 green:0x4c/255.0 blue:0x4c/255.0 alpha:1];
    
    
    //#ifdef Main
    if([getUIStyle() isEqualToString:STYLE0]){
        NSLog(@"主项目程序");
        self.titleRightImg.image = [UIImage imageNamed:@"列表详细_"];
        [self.mormalBtn setImage:[UIImage imageNamed:@"xiangguan"] forState:UIControlStateNormal];
        [self.mormalBtn setImage:[UIImage imageNamed:@"xiangguan_h"] forState:UIControlStateHighlighted];
        _titleLeftImg.backgroundColor = [UIColor colorWithRed:0x5d/255.0 green:0xa6/255.0 blue:0xff/255.0 alpha:1];
        
    }else{
        //#elif Student
        
        NSLog(@"学员端程序");
        self.titleRightImg.image = [UIImage imageNamed:@"basics_into"];
        self.titleRightImg.hidden = YES;//去掉红色小箭头
        //    [self.mormalBtn setImage:[UIImage imageNamed:@"xiangguan"] forState:UIControlStateNormal];
        //    [self.mormalBtn setImage:[UIImage imageNamed:@"xiangguan_h"] forState:UIControlStateHighlighted];
        [self.mormalBtn setBackgroundColor:[UIColor colorWithHex:0xff9a41]];
        self.mormalBtn.layer.cornerRadius = 5;
        [self.mormalBtn setTitle:@"查看相关列表" forState:UIControlStateNormal];
        [self.mormalBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//        _titleLeftImg.backgroundColor = [UIColor colorWithHex:0xef5152];
        [_titleLeftImg setImage:[UIImage imageNamed:@"red"]];
    }
    //#elif Teacher
    //    //    rootview
    //    NSLog(@"老师端程序");
    //#else
    //
    //    NSLog(@"都不是");
    //#endif
    
    
    
    _imgLine.image = [UIImage imageNamed:@"line"];
    //    titleImgView.layer.cornerRadius = 8;
    
    return self.baseView;
}

-(void)setCnName:(NSMutableArray *)cnName{
    _cnName = cnName;
    
    if (_cnName.count>=2){
        _Label1.text = [NSString stringWithFormat:@"%@", [_cnName[1] valueForKey:@"fieldCnName"]];
    }else{
        _Label1.text = @"";
    }
    if (_cnName.count>=3){
        _Label2.text =[NSString stringWithFormat:@"%@",  [_cnName[2] valueForKey:@"fieldCnName"]];
    }else{
        _Label2.text =@"";
    }
    if (_cnName.count>=4){
        _Label3.text =[NSString stringWithFormat:@"%@",  [_cnName[3] valueForKey:@"fieldCnName"]];
    }else{
        _Label3.text =@"";
    }
    if (_cnName.count>=5){
        _Label4.text =[NSString stringWithFormat:@"%@",  [_cnName[4] valueForKey:@"fieldCnName"]];
    }else{
        _Label4.text =@"";
    }
    
    _titleLabel.text = @"";
    _Label1R.text = @"";
    _Label2R.text =@"";
    _Label3R.text =@"";
    _Label4R.text =@"";
    
    
    for (id IDA in _arrqqqqqqqqqq) {
        NSString *strA = [NSString stringWithFormat:@"%@", IDA];
        
        if(_cnName.count>=1){
            NSString *testStr = [NSString stringWithFormat:@"%@", [_cnName[0] valueForKey:@"fieldAliasName"]] ;
            NSLog(@"%@",testStr);
            
            if ([testStr isEqualToString:strA]) {
                _titleLabel.text = [NSString stringWithFormat:@"%@", [_dic valueForKey:strA]];
                
                
                //                NSString *dicStr =[_dic objectForKey:@"fieldAliasName"];
                NSString *lastStr = [NSString stringWithFormat:@"DIC_%@",strA];
                
                //&&![_dic valueForKey:strA]
                if([[_dic valueForKey:strA] isKindOfClass:[NSNumber class]]&&![_dic valueForKey:strA]){
                    _titleLabel.text =[NSString stringWithFormat:@"%@", [_dic objectForKey:lastStr]];
                }
                
            }
        }
        if(_cnName.count>=2){
            NSString *testStr = [NSString stringWithFormat:@"%@", [_cnName[1] valueForKey:@"fieldAliasName"]] ;
            NSLog(@"%@",testStr);
            
            if ([testStr isEqualToString:strA]) {
                _Label1R.text = [NSString stringWithFormat:@"%@", [_dic valueForKey:strA]];
                
                
                //                NSString *dicStr =[_dic objectForKey:@"fieldAliasName"];
                NSString *lastStr = [NSString stringWithFormat:@"DIC_%@",strA];
                
                //&&![_dic valueForKey:strA]
                if([[_dic valueForKey:strA] isKindOfClass:[NSNumber class]]&&![_dic valueForKey:strA]){
                    _Label1R.text =[NSString stringWithFormat:@"%@", [_dic objectForKey:lastStr]];
                }
                
            }
        }
        if(_cnName.count>=3){
            if ([[NSString stringWithFormat:@"%@", [_cnName[2] valueForKey:@"fieldAliasName"]] isEqualToString:strA]) {
                NSString *time = [NSString stringWithFormat:@"%@", [_dic valueForKey:strA]];
                _Label2R.text = time;
                if (time) {
                    NSArray *timeArr = [time componentsSeparatedByString:@"-"];
                    if (timeArr.count == 3) {
                        NSString *year = [timeArr objectAtIndex:0];
                        NSString *mon = [timeArr objectAtIndex:1];
                        NSString *day = [timeArr objectAtIndex:2];
                        NSLog(@"月份：%@ 日期：%@",mon,day);
                        if (year) {
                            _yearLabel.text = year;
                            _yearLabel.hidden = NO;
                        }
                        if (mon) {
                            _monLabel.text = [NSString stringWithFormat:@"%@月",mon];
                            _monLabel.hidden = NO;
                        }
                        if (day) {
                            NSArray *array = [day componentsSeparatedByString:@" "];
                            if (array.count >= 1) {
                                _dayLabel.text = [NSString stringWithFormat:@"%@日",[array firstObject]];
                            }else{
                                _dayLabel.text = [NSString stringWithFormat:@"%@日",day];
                            }
                            
                            _dayLabel.hidden = NO;
                        }
                    }
                }
                
                
                NSString *lastStr = [NSString stringWithFormat:@"DIC_%@",strA];
                
                if([[_dic valueForKey:strA] isKindOfClass:[NSNumber class]]&&![_dic valueForKey:strA]){
                    _Label2R.text =[NSString stringWithFormat:@"%@", [_dic objectForKey:lastStr]];
                    
                    NSLog(@"%@", [_dic objectForKey:lastStr]);
                }
                
            }
        }
        
        if(_cnName.count>=4){
            if ([[NSString stringWithFormat:@"%@", [_cnName[3] valueForKey:@"fieldAliasName"]] isEqualToString:strA]) {
//                .text = [NSString stringWithFormat:@"%@", [_dic valueForKey:strA]];
                NSString *time = [NSString stringWithFormat:@"%@", [_dic valueForKey:strA]];
                _Label3R.text = time;
                if (time) {
                    NSArray *timeArr = [time componentsSeparatedByString:@"-"];
                    if (timeArr.count == 3) {
                        NSString *year = [timeArr objectAtIndex:0];
                        NSString *mon = [timeArr objectAtIndex:1];
                        NSString *day = [timeArr objectAtIndex:2];
                        NSLog(@"月份：%@ 日期：%@",mon,day);
                        if (year) {
                            
                            _yearLabel.text = [NSString stringWithFormat:@"%@",year];
                            _yearLabel.hidden = NO;
                        }
                        if (mon) {
                            _monLabel.text = [NSString stringWithFormat:@"%@月",mon];
                            _monLabel.hidden = NO;
                        }
                        if (day) {
                            NSArray *dayArray = [day componentsSeparatedByString:@" "];
                            if (dayArray.count>0) {
                                NSString *dayStr = [dayArray firstObject];
                                _dayLabel.text = [NSString stringWithFormat:@"%@日",dayStr];
                                _dayLabel.hidden = NO;
                            }
                            
                        }
                    }
                
                
                }

                //                NSString *dicStr =[_dic objectForKey:@"fieldAliasName"];
                NSString *lastStr = [NSString stringWithFormat:@"%@",strA];
                if([[_dic valueForKey:strA] isKindOfClass:[NSNumber class]]&&![_dic valueForKey:strA]){
                    _Label3R.text =[NSString stringWithFormat:@"%@", [_dic objectForKey:lastStr]];
                }
                
            }
        }
        
        if(_cnName.count>=5){
            if ([[NSString stringWithFormat:@"%@", [_cnName[4] valueForKey:@"fieldAliasName"]] isEqualToString:strA]) {
                _Label4R.text = [NSString stringWithFormat:@"%@", [_dic valueForKey:strA]];
                
                //                NSString *dicStr =[_dic objectForKey:@"fieldAliasName"];
                NSString *lastStr = [NSString stringWithFormat:@"%@",strA];
                if([[_dic valueForKey:strA] isKindOfClass:[NSNumber class]]&&![_dic valueForKey:strA]){
                    _Label4R.text =[NSString stringWithFormat:@"%@", [_dic objectForKey:lastStr]];
                }
                
            }
        }
        
    }
    //    _image = [_dic objectForKey:@"AFM_1"];
    //NSString * titleStr = [NSString stringWithFormat:@"%@", [_dic objectForKey:_arrqqqqqqqqqq[0]]];
    
    
    //_titleLabel.text = titleStr;
    
    //NSLog(@"%@", _Label2R.text);
    
    
    
}

-(void)setDic:(NSDictionary *)dic{
    _dic = dic;
    
    NSArray *arrqqqqq = [dic allKeys];
    arrqqqqq = [arrqqqqq sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2){
        NSComparisonResult result = [obj1 compare:obj2];
        return result==NSOrderedDescending;
    }];
    _arrqqqqqqqqqq = arrqqqqq;
}
/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */

@end
